var express = require('express');
var router = express.Router();
var nodemailer = require("nodemailer");
var path = require('path');
var smtpTransport = require('nodemailer-smtp-transport');

/* GET users listing. */
router.get('/', function (req, res, next) {
  const captcha = req.query.yzm;
  console.log("22222");
  if (captcha != req.session.captcha) {
    console.log("11111");
    res.send('1'); //验证码错误
  } else {
    console.log("33333");
    res.send('2'); //验证成功
    // 验证通过，删除保存的验证码
    delete req.session.captcha;
  }
});

module.exports = router;